package com.gugee.ins.common.model.spider.media;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.gugee.ins.common.model.spider.blogger.EdgeBloggerNode;
import lombok.Data;

import java.util.List;

/**
 *
 * @author Huangxin
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class EdgeMediaNode {

    @JsonProperty("id")
    private Long mid;

    private String shortcode;

    @JsonProperty("__typename")
    private String typename;

    @JsonProperty("display_url")
    private String displayUrl;

    @JsonProperty("is_video")
    private boolean isVideo;

    @JsonProperty("video_url")
    private String videoUrl;

    @JsonProperty("video_view_count")
    private long videoViewCount;

    @JsonProperty("edge_media_to_caption")
    private EdgeMediaCaption edgeMediaToCaption;

    @JsonProperty("edge_media_to_tagged_user")
    private EdgeMediaTaggedUser edgeMediaToTaggedUser;

    @JsonProperty("edge_media_to_comment")
    private EdgeMediaToComment edgeMediaToComment;

    @JsonProperty("edge_media_to_sponsor_user")
    private EdgeMediaSponsorUser edgeMediaToSponsorUser;

    @JsonProperty("comments_disabled")
    private boolean commentsDisabled;

    @JsonProperty("taken_at_timestamp")
    private long takenTime;

    @JsonProperty("edge_media_preview_like")
    private EdgeMediaPreviewLike edgeMediaPreviewLike;

    @JsonProperty("edge_sidecar_to_children")
    private EdgeSidecarChildren edgeSidecarToChildren;

    private EdgeBloggerNode owner;

    private MediaLocation location;

    @JsonProperty("product_type")
    private String productType;

    /**
     *
     * @author Huangxin
     */
    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class EdgeMediaToComment {
        private int count;
    }

    /**
     *
     * @author Huangxin
     */
    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class EdgeMediaPreviewLike {
        private long count;
    }

    /**
     *
     * @author Huangxin
     */
    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class EdgeMediaTaggedUser {
        private List<EdgeBlogger> edges;
    }

    /**
     *
     * @author Huangxin
     */
    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class EdgeMediaSponsorUser {
        private List<EdgeMediaSponsorBlogger> edges;
    }

    /**
     *
     * @author Huangxin
     */
    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class EdgeSidecarChildren {
        private List<EdgeMediaChildrenBody> edges;
    }

    /**
     *
     * @author Huangxin
     */
    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class MediaLocation {
        private Long id;
        private String name;
    }
}